package org.kkk.sandbox.enums;


import org.kkk.sandbox.model.CaseExecuteInfo;

/**
 *
 * description:  判题信息的枚举值
 * @author  lenovo
 * create 2024/5/23-19:42 */

public enum JudgeInfoMessageEnum {
    ACCEPTED(200,"成功") ,
    WRONG_ANSWER(401,"答案错误"),
    COMPILE_ERROR(402,"编译错误"),
    MEMORY_LIMIT_EXCEEDED(403,"内存溢出"),
    TIME_LIMIT_EXCEEDED(404,"超时"),
    PRESENTATION_ERROR(405,"展示错误"),
    OUTPUT_LIMIT_EXCEEDED(406,"输出溢出"),
    WAITING(0,"等待中"),
    DANGEROUS_OPERATION(500,"危险操作"),
        //用户程序的问题
    RUNTIME_ERROR(407,"运行错误"),
            //做系统人的问题
    SYSTEM_ERROR (502,"系统错误");
    private String message;
    private Integer code;

    public Integer getCode() {
        return code;
    }
    public static JudgeInfoMessageEnum getState(Integer code)
    {
        for (JudgeInfoMessageEnum value : JudgeInfoMessageEnum.values()) {
            if(value.code.equals(code))
            {
                return value;
            }
        }
        return null;
    }
    public String getMessage() {
        return message;
    }
    JudgeInfoMessageEnum( Integer code,String message) {
        this.message = message;
        this.code = code;
    }
}
